1. Field of the Invention
The present invention relates to disk drive performance features, and more particularly to a disk drive having a cache control system for improving the disk drive""s response time to host commands.
2. Description of the Prior Art
A host computer stores and accesses data on a disk drive by issuing commands to the disk drive over a standardized interface. The smallest indivisible data unit addressable on a disk is a logical block or disk sector, typically of 512 bytes, and each such disk sector is assigned a logical block address (LBA). When the host computer sends a command to the disk drive, the nature of the command is specified, e.g., read or write, along with a start LBA and a count specifying the number of contiguous sectors to be transferred.
Existing disk drives typically have a semiconductor cache memory for temporarily storing disk data that is likely to be requested by a host computer. The response time latency for storing and accessing data in a semiconductor memory is much smaller than the response time latency for mechanically storing and accessing data stored on a rotating disk. In existing disk drives, disk data is generally cached in contiguous fixed length memory segments. The memory segments may be inefficiently configured to order to accommodate host commands having a long LBA range thereby wasting valuable data storage space in the cache memory if such commands occur infrequently.
Accordingly, there exists a need for a disk drive having a disk cache system for efficiently allocating and configuring memory segments for responding to host commands. The present invention satisfies these needs.
The invention may be embodied in a disk drive, and related method, for servicing host disk commands using a cache memory having a plurality of sequentially-ordered memory clusters for caching disk data of disk sectors identified by logical block addresses. The disk drive includes a cache control system having a plurality of cluster control blocks and a tag memory usable only for providing a plurality of tag records. Each cluster control block has a cluster segment record for associating the cluster control block with a particular memory cluster and for forming variable length segments of the memory clusters without regard to the sequential order of the memory clusters. Each tag record assigns a segment to a contiguous range of logical block addresses and defines the cluster control blocks forming the segment. Each segment of the memory clusters is for caching disk data of the assigned contiguous range of logical block addresses.
In more detailed features of the invention, the cluster segment record of each cluster control block associated with a segment may include a pointer to a subsequent cluster control block or to indicate an end cluster control block of the segment. Each tag record may define a length for the assigned segment by pointing to a first cluster control block and by pointing to a last cluster control block for the segment or by indicating a count of cluster control blocks for the segment. Also, the memory clusters may be uniformly sized.
In other more detailed features of the invention, the disk drive may further include a free list for identifying cluster control blocks not associated with a tag memory record and forming a segment of the identified cluster control blocks. Each tag record for an assigned segment may point to a first cluster control block, a last cluster control block, and indicate a count of sectors for the segment. A length of an original assigned segment may be increased by removing a segment of cluster control blocks from the free list segment, changing the original segment""s last cluster control block to point to a first cluster control block of the removed segment, and changing the tag record to point to the last cluster control block of the removed segment. The disk drive also may include a microprocessor that de-allocates an existing assigned segment and assigns the segment""s associated cluster control blocks to the free list if a sufficient number of cluster control blocks are not available on the free list to enable caching of a range of logical block addresses requested by a host command.